import java.util.List;
import java.util.Map;

public class Teacher {
    private String teacherId;
    private String name;

    public Teacher(String teacherId, String name) {
        this.teacherId = teacherId;
        this.name = name;
    }

    public void viewClassLists(Database database) {
        Map<String, List<String>> classLists = database.generateClassLists();
        System.out.println("教师 " + name + " 查看班级列表：");
        for (Map.Entry<String, List<String>> entry : classLists.entrySet()) {
            System.out.println(entry.getKey() + ":");
            for (String student : entry.getValue()) {
                System.out.println("  - " + student);
            }
        }
    }
}
